<?php

class AutoApprovalSettingAction extends CAction {
    public function run() {
        $model = new SettingAutoApproval();
        
        if(isset($_POST['SettingAutoApproval'])) {
            $model->attributes = $_POST['SettingAutoApproval'];
            if($model->validate()) {
                Utility::setFlash('Settings saved successfully.', 'success');
                $model->save();
            }
        }
        
        Yii::app()->controller->render('ext.plugins.AutoApproval.views.form', array(
            'model' => $model,
        ));
    }
}